package com.platform.modules.acme.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.platform.modules.acme.component.ChallengeType;
import com.platform.modules.acme.entity.AcmeOrderEntity;
import org.shredzone.acme4j.Order;
import org.shredzone.acme4j.challenge.Challenge;

import java.net.MalformedURLException;
import java.util.List;
import java.util.Map;
import java.util.Set;


public interface AcmeOrderService extends IService<AcmeOrderEntity> {


    /**
     * Create order
     *
     * @param domainNames
     * @return
     */
    Order createOrder(Set<String> domainNames);



    /**
     * Get Authorization info with domainNames and challengeType by clients
     * @param domainNames
     * @param challenge
     * @param memberId
     * @param csrData
     * @return
     */
    Map<String, Object> getVerifyInfo(Set<String> domainNames, String challenge, String memberId, String csrData);

    /**
     * verify the domain's authorization and get certificate from server
     *
     * @param orderId
     */
    Map<String, Object> verifyAuth(String orderId);

    /**
     * packing certificate on disk
     */
    void getCertificate(String orderId);

    /**
     * 分页查询
     *
     * @param params 查询参数
     * @return Page
     */
    Page queryPage(Map<String,Object> params);



}
